﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Resto.CostControl.Core.Models;

namespace Resto.CostControl.Core
{
    /// <summary>
    /// 各个项目点的发货单
    /// </summary>
    public class Delivery : BaseModel
    {
        public Delivery()
        {
            ItemDesc = string.Empty;
        }

        public string Id { get; set; }

        [Display(Name = "编号")]
        public string Code { get; set; }

        [Display(Name = "状态")]
        public string State { get; set; }

        [Display(Name = "送货日期")]
        public DateTime Date { get; set; }

        [Display(Name = "送货地址")]
        public string Address { get; set; }

        [Display(Name = "项目点")]
        public string SiteID { get; set; }

        [Display(Name = "项目点")]
        public string SiteName { get; set; }

        [Display(Name = "备注")]
        public string Remark { get; set; }

        [Display(Name = "品名汇总")]
        public string ItemDesc { get; set; }

        public IList<DeliveryItem> Items { get; set; }
    }

    public class DeliveryItem
    {
        public string Id { get; set; }

        /// <summary>
        /// 订单Id
        /// </summary>
        public string OrderId { get; set; }

        [Display(Name = "品名Id")]
        public string MaterialId { get; set; }

        [Display(Name = "品名编号")]
        public string Code { get; set; }

        [Display(Name = "品名名称")]
        public string Name { get; set; }

        [Display(Name = "价格")]
        public decimal Price { get; set; }

        [Display(Name = "品名大类")]
        public string Category { get; set; }

        [Display(Name = "订购数")]
        public decimal OrderCount { get; set; }

        [Display(Name = "发货数")]
        public decimal DeliveryCount { get; set; }

        [Display(Name = "签收数")]
        public decimal SignCount { get; set; }

        [Display(Name = "状态")]
        public string State { get; set; }
    }
}
